# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=cdpsnarf
pkgver=0.1.6
pkgrel=7
groups=('blackarch' 'blackarch-sniffer')
pkgdesc='Cisco discovery protocol sniffer.'
url='https://github.com/Zapotek/cdpsnarf'
license=('GPL-2.0-only')
arch=('x86_64' 'aarch64')
depends=('libpcap')
makedepends=('git')
source=("git+https://github.com/Zapotek/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  grep -m1 'v[0-9].*[0-9].*[0-9]' README | cut -d'v' -f2 | awk '{ print $1 }'
}

build() {
  cd $pkgname

  make all
}

package() {
  cd $pkgname

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README
}

